<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('使用记录列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
<!--            <div class="col-sm-12 search-collapse">-->
<!--                <form id="formId">-->
<!--                    <div class="select-list">-->
<!--                        <ul>-->
<!--                            <li>-->
<!--                                <input type="text" name="deviceName" placeholder="请输入仪器名称"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <input type="text" name="createPerson" placeholder="请输入操作人"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <input placeholder="请输入设备型号" name="type" type="text">-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <select name="operateName">-->
<!--                                    <option value="">请选择操作名称</option>-->
<!--                                    <option value="0">入库</option>-->
<!--                                    <option value="1">出库</option>-->
<!--                                    <option value="2">新增</option>-->
<!--                                    <option value="3">编辑</option>-->
<!--                                    <option value="4">删除</option>-->
<!--                                </select>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>-->
<!--                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>-->
<!--                            </li>-->
<!--                        </ul>-->
<!--                    </div>-->
<!--                </form>-->
<!--            </div>-->

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">

        var detailFlag = [[${@permission.hasPermi('Use:record:detail')}]];
        var removeFlag = [[${@permission.hasPermi('Use:record:remove')}]];
        var operateName = [[${@dict.getType('tmd_device_operate_name')}]];
        var prefix = ctx + "Use/record";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                detailUrl: prefix + "/detail/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "使用记录",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '编号',
                    visible: false
                },
                    {
                        title: "编号",
                        formatter: function (value, row, index) {
                            return $.table.serialNumber(index);
                        },
                        align: 'center',
                    },
                {
                    field: 'deviceName',
                    title: '设备名称',
                    align: 'center',
                },
                {
                    field: 'type',
                    title: '设备型号',
                    align: 'center',
                },
                {
                    field: 'savePosition',
                    title: '存放位置',
                    align: 'center',
                },
                {
                    field:'userName',
                    title:'操作人',
                    align: 'center',
                },
                {
                   field:'operateTime',
                   title:'操作时间',
                    align: 'center',
                },
                {
                    field: 'operateName',
                    title: '操作名称',
                    align: 'center',
                    formatter: function (value) {
                        return $.table.selectDictLabel(operateName, value);
                    },
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>